:root {
    --primary-color: #438AFF;
    --success-color: #28a745;
    --error-color: #ff4444;
    --chat-bg: #f5f6fa;
    --input-focus-shadow: 0 0 8px rgba(67, 138, 255, 0.2); /* 新增变量 */
}

/* 修复浏览器兼容性警告 */
.login-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px); /* 添加 Webkit 前缀 */
}

/* 修复嵌套规则问题 */
.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--input-focus-shadow);
}

/* 修复动画兼容性 */
@keyframes dotWave {
    0%, 60%, 100% { 
        transform: translateY(0);
        -webkit-transform: translateY(0); 
    }
    30% { 
        transform: translateY(-8px);
        -webkit-transform: translateY(-8px);
    }
}

/* 新增居中布局样式 */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* 登录/注册容器统一样式 */
.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* 统一输入框组布局 */
.input-group {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 12px;
    align-items: center;
    margin-bottom: 1.5rem;
}

.input-group label {
    font-size: 0.95rem;
    color: #495057;
    white-space: nowrap;
}

/* 统一输入框样式 */
.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e3e8;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 注册页面同步样式 */
.register-container {
    @extend .login-container; /* 如果使用Sass，否则复制相同样式 */
}

/* 统一按钮悬停效果 */
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.error-message {
    color: #dc3545;
    margin-top: 1.5rem;
    text-align: center;
}

/* 聊天界面 */
/* 移除旧版聊天样式，新增以下内容 */

/* 聊天主容器 */
.chat-interface {
    max-width: 1200px;
    height: 100vh; /* 改为视口高度 */
    margin: 0 auto; /* 移除上下外边距 */
    background: rgba(255, 255, 255, 0.98);
    border-radius: 1.5rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    display: flex;
    min-height: 80vh;
}

/* 侧边栏设置区域 */
.settings-panel {
    width: 280px;
    background: linear-gradient(160deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.settings-panel h2 {
    color: #2c3e50;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* 全局样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* 聊天容器 */
.chat-container {
    display: flex;
    width: 90%;
    max-width: 1200px;
    height: 80vh;
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 聊天设置区域 */
.chat-settings {
    width: 25%;
    padding: 24px;
    background-color: #f1f3f5;
    border-right: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
}

.setting-item {
    margin-bottom: 16px;
}

.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.setting-item input,
.setting-item select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.setting-item input:focus,
.setting-item select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

#apply-settings {
    padding: 12px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#apply-settings:hover {
    background-color: #0056b3;
}

/* 聊天主区域 */
.chat-main {
    width: 75%;
    display: flex;
    flex-direction: column;
}

/* 聊天历史区域 */
.chat-history {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.message {
    padding: 12px 16px;
    border-radius: 16px;
    margin-bottom: 16px;
    max-width: 70%;
    word-wrap: break-word;
}

.user-message {
    background-color: #007bff;
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.ai-message {
    background-color: #e9ecef;
    color: #343a40;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.loading {
    color: #6c757d;
    font-style: italic;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
}

/* 聊天输入区域 */
.chat-input {
    padding: 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
}

#user-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 16px;
    margin-right: 16px;
    transition: border-color 0.3s ease;
}

#user-input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

#send-button {
    padding: 12px 24px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#send-button:hover {
    background-color: #0056b3;
}
